<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	version="1.0"  >
	
	<xsl:template match="/canss">
		<html>
			<body>
				<h1>
					Feed List			
				</h1>
				<xsl:template match="canssPerson_Person">
					<table class="datatable">
						<tbody>
							<th scope='col'>Owner</th>
							<th scope='col'><center>No</center></th>
							<th scope='col'>FeedUri</th>
							<th scope='col'>Feed Rule</th>
							<th scope='col'>Feed Rule 관리</th>
							<th scope='col'>할당된 모듈 ID</th>
							<!--<th scope='col'>Feed Status Description</th>-->
							<th scope='col'>Feed 관리</th>
							
							<xsl:for-each select="canssPerson_Person">
								<xsl:variable name="v_index"><xsl:number format="1"/></xsl:variable>
								<xsl:for-each select="canssFeed_feedlist">
									<xsl:for-each select="canssFeed_feed">
										<tr>
											<td class="singleentry">
												<xsl:value-of select="/canss/canssPerson_Person/canssPerson_id"/>
											</td>
											<td scope='col'>
												<center><xsl:value-of select="$v_index"/></center>
											</td>
											<td>
												<xsl:variable name="v_feeduri" select="canssTrace_feeduri"/>
												<a href="{$v_feeduri}" target="_blank" 
													style='cursor:pointer' onmouseover="this.style.color='red'" onmouseout="this.style.color=''">
													<xsl:value-of select="canssTrace_feeduri"/>
												</a>
											</td>
											<td class="singleentry">
												<xsl:if test="true()=canssTrace_ruleid/text()">
													<xsl:value-of select="canssTrace_rulename"/>
												</xsl:if>
												<xsl:if test="true()!=canssTrace_ruleid/text()">
													- 미등록 -
												</xsl:if>
											</td>
											<td class="singleentry">
												<!-- rule 관리 -->
												<form id="frm_rulemanager_{$v_index}" method="post" action="http://mediator.canss.net/MetadataManager/RuleManager.php" target="_blank">
												<xsl:variable name="pid"><xsl:value-of select="/canss/canssPerson_Person/canssPerson_id"/></xsl:variable>
												<xsl:variable name="feeduri"><xsl:value-of select="canssTrace_feeduri"/></xsl:variable>
													<input type="hidden" name="_feed" value="{$feeduri}"/>
													<input type="hidden" name="_cpid" value="{$pid}"/>
													<input 
														class="maxsize"
														onclick="var frm=getobj('frm_rulemanager_{$v_index}');if(!frm)return;window.open('','pop_rulemanager','width=740,height=850');frm.target='pop_rulemanager';frm.submit();" 
														type="button" value="Rule관리"/>
												</form>
											</td>
											<td>
												<xsl:value-of select="canssTrace_ProviderModuleID"/>
											</td>
											<!--<td>
												<xsl:value-of select="canssTrace_feedstatusdesc"/>
											</td>-->
											<td class="singleentry">
												<xsl:choose>
													<xsl:when test="canssTrace_feeduri!=''">
														<xsl:variable name="pid"><xsl:value-of select="/canss/canssPerson_Person/canssPerson_id"/></xsl:variable>
														<xsl:variable name="mid"><xsl:value-of select="canssTrace_ProviderModuleID"/></xsl:variable>
														<xsl:variable name="feeduri"><xsl:value-of select="canssTrace_feeduri"/></xsl:variable>
														<a href="svtAjaxDeleteFeed?_pid={$pid}&amp;_mid={$mid}&amp;_feeduri={$feeduri}&amp;_rurl=mainframe.jsp?_pagenum=9">삭제</a>
												 	</xsl:when>
												 	<xsl:otherwise>
												 	</xsl:otherwise>
												 </xsl:choose>
											</td>
										</tr>
									</xsl:for-each>
								</xsl:for-each>
							</xsl:for-each>
							
							<tr>
								<td>-</td>
								<td></td>
								<td colspan="5" style="text-align: right;">
									<form method="post" action="svtAjaxAddFeed">
											<xsl:variable name="pid"><xsl:value-of select="/canss/canssPerson_Person/canssPerson_id"/></xsl:variable>
											FeedURI: <input type="text" name="_feeduri"/>
											<input type="hidden" name="_pid" value="{$pid}"/>
											<input type="hidden" name="_rurl" value="mainframe.jsp?_pagenum=9"/>
											<input type="submit" value="추가" onclick=""/>
									</form>
								</td>
							</tr>
						</tbody>		
					</table>
				</xsl:template>
			</body>
		</html>
	</xsl:template> 
</xsl:stylesheet>